    <!DOCTYPE html>
<html>
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<link type="text/css" href="/css/cultivateWeb/style/news.css" rel="stylesheet">
<link type="text/css" href="/css/cultivateWeb/style/teach.css" rel="stylesheet">
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="layui-container">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > 创新创业</p>
    </div>
    <div class="div1">
        <a href="#"><span class="news sz" id="star" a="0">创业明星</span></a>
        <a href="#  "><span class="sp sz" id="join" a="1">创业加盟</span></a>
    </div>
    <div id="mx" style="width: 1100px;margin: 0px auto">
        <div id="news" class="p_div2">
        </div>
        <div id="page0" class="page"></div>
           <div id="page1" class="page" style="display: none"></div>
    </div>
    <div style="clear: both;margin-bottom: 50px"></div>
    <!-- 分页 -->
</div>
<!-- footer ------------------------------------------------------- -->
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</body>
<script>
    $(function () {
        $(".sz").click(function () {
            $(this).addClass("news");
            $(this).parent().siblings().find(".sz").removeClass("news");
            $(this).parent().siblings().find(".sz").addClass("sp");
            mr($(this).text());
        });
        mr("创业明星");
    });

    function mr(name){
        $.ajax({
            url: "/jzApi/index/selNewsList",
            type: 'GET',
            data: {
                firstColumn:'培训就业门户',
                columnName:name,
                current: 1,
                number:18
            },
            success: function (res) {
                // console.log("res",res.data.pages)
                if(res.data.pages==0){
                    $("#news").html('<div class="noData">暂无数据</div>');
                }else{
                    var list = res.data.records;
                    var news = '';
                    var a ='';
                    list.forEach(function (item, index) {
                        news +='<ul class="p_div"><li>' +
                            '<a href="/notice/newsInfo?name='+name+'&'+'id='+item.id+'"' +
                            '>' +
                            '<div>' +
                            '<img src="'+item.thumbnail+'"class="p_img" alt="">' +
                            '</div>'+
                            '<div>' +
                            '<span style="font-size: 18px;margin: auto auto auto 15px">'+item.title+'</span>' +
                            '</div>' +
                            '</a>' +
                            '</li></ul>';
                    });
                    news +='<div style="clear: both"></div>';
                    $("#news").html(news);
                    page(1,res.data.pages ,"培训就业门户", name);
                }
            }
        })
    }

    function page(num,tolPages ,firstColumn ,columnName) {
          var a = '';
        if(columnName == '创业明星') {
            a = '#page0';
            $("#page0").show();
            $("#page1").hide();
        } else if(columnName == '创业加盟') {
            a = '#page1';
            $("#page0").hide();
            $("#page1").show();
        }
        $(a).paging({
            nowPage:Number(num), // 当前页码
            pageNum:Number(tolPages), // 总页码
            buttonNum:10, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                $.ajax({
                    url: "/jzApi/index/selNewsList",
                    type: 'GET',
                    data: {
                        firstColumn:firstColumn,
                        columnName:columnName,
                        current: num,
                        number:18
                    },
                    success:function (res) {
                        var list = res.data.records;
                        var news = '';
                        list.forEach(function (item, index) {
                            news +='<ul class="p_div"><li>'+
                                '<a href="/notice/newsInfo?name='+columnName+'&'+'id='+item.id+'"' +
                                '<div>' +
                                '<img src="'+item.thumbnail+'"class="p_img" alt="">' +
                                '</div>' +
                                '<div>' +
                                '<span style="font-size: 18px;margin: auto auto auto 15px">'+item.title+'</span>' +
                                '</div>' +
                                '</a>' +
                                '</li></ul>';
                        });
                        news +='<div style="clear: both"></div>';
                        $("#news").html(news);
                    }
                });
            }
        });
    }
</script>
</html>